//
// Created by Administrator on 24-9-14.
//
#include <QObject>
#include "mfmcustomplot.h"
#ifndef RECEIVER_H
#define RECEIVER_H
#include<QSerialPort>
#include<QSerialPortInfo>
#include <QDebug>
constexpr int PER_READ = 64;

class Receiver : public QObject
{
    Q_OBJECT

public:
    explicit Receiver(QObject* parent = nullptr);
    void clearGR(int flag);
    void parseToInt32(QByteArray byteArray);
    void recieveData();
    QSerialPort* serialPort = nullptr;
    MFMCustomPlot* plot;
    MFMCustomPlot* plot2;
    void openS(QString s);
    void closeS();
    void changeAB(double a,double b,int index);
    std::vector<double> aVector={1,1,1,1,1,1,1,1};
    std::vector<double> bVector={0,0,0,0,0,0,0,0};
private:
    QByteArray serialData;
signals:
    void changePushButton(bool);
};
#endif //RECEIVER_H
